package com.function;

import java.util.function.Function;

/**
 * @Author: 许磊磊
 * @Date: 2022/10/17 16:45
 * @Version 1.0
 */
public class FunctionTest {

    public static void main(String[] args) {
//        Function<String, Integer> function = (s) -> Integer.parseInt(s);
//        System.err.println(function.apply("100"));

        Function<String, Integer> function=s->{
        if(s!=null&&s.length()<5&&!"".equals(s.trim())){
            return Integer.parseInt(s);
        }else return null;
        };

        System.err.println(function.apply("1000"));

    }

}
